feat(tools): add HumanTool for human intervention during agent workflows - Step 1 #202
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue(s) does this pull-request address?
Issue #121
Step 1: Define the 'HumanTool' as a tool which can be equipped to any Bee and be invoked by it when it deems there is some missing information required for the following steps and hence must call out to the user to collect it. So I agree with you on the following:
Tool Name: 'HumanTool'
Tool Input: For a Bee to use this tool, it should generate a NL message asking the user for some specific information.
Tool Output: NL response from the end user
BeeAgentRunner 'HumanTool' Execution: The Runner should then execute the HumanTool by sending the NL message to the end user and wait for a response. Once the user has responded, the tool output (message from the user) is appended to the Agent memory and the loop for Action and ActionInput can continue
Closes: #121 - Step 1
Description
1. Implementation of
HumanTool
/src/tools/human.ts
HumanTool
, allows human intervention by:2. Helper for Console Interaction
/src/helpers/io.ts
sharedConsoleReader
) to handle user prompts and display messages cleanly.3. Example Agent
/examples/agents/experimental/humantool_agent.ts
HumanTool
and use it in a workflow:HumanTool
with an environment variable (USE_HUMAN_TOOL
).HumanTool
.Testing
yarn lint
runs without errors or warnings.Notes
HumanTool
is designed for natural language interaction and can be further extended in subsequent steps.Checklist
yarn lint
oryarn lint:fix
yarn format
oryarn format:fix
yarn test:unit
yarn test:e2e